package sc.love.boot.listener;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

/**
 * @ClassName SpringListener
 * @Description spring 监听  基于思想：对修改关闭，对扩展开放
 * @Author 15393
 * @Date 2020/5/27 17:51
 * @Version V1.0
 */
@Service
public class SpringListenerService {

    @EventListener(UserListener.class)
    public void listener1() {
        System.out.println("用户登录我要主动缓冲一些东西增加效率-");
    }

    @EventListener(UserListener.class)
    public void listener2(){
        System.out.println("用户登录了，我要发个邮件告诉我大哥");
    }
}